Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submit data entry from frontend to backend API #31

Merged
merged 9 commits into from
May 17, 2024

Conversation

lkleuver
Copy link
Contributor

No description provided.

@lkleuver lkleuver requested a review from praseodym April 26, 2024 11:38
@praseodym
Copy link
Contributor

praseodym commented Apr 29, 2024

Could you rebase this branch to get rid of the commits that were already merged to the main branch in older PRs?

@praseodym praseodym force-pushed the data-entry-api-frontend branch 4 times, most recently from 798f186 to 7f8658a Compare April 29, 2024 14:46
@lkleuver lkleuver requested a review from jschuurk-kr May 2, 2024 08:38
@jschuurk-kr
Copy link
Contributor

@lkleuver I'm trying to build a test similar to the example in the React Testing Library docs and am running into two issues.

1. There's no easy way to add a handler to the mock that overrides the default ones for a specific test.

2. I extended VotersAndVotesForm.test.tsx to click the button and check for the success and/or error element in the page. Even after I make sure startMockAPI() is not called in app/main.tsx, when I run the test, the DOM still contains <p>id="success">Success</p>. So it seems the mock returns a response, even though it's not running?

The only way so far I've found to get the error <p>-element in the DOM is by changing the pollingStationDataEntryHandler to return a 422 if "voters_counts" in json.data.

@lkleuver lkleuver force-pushed the data-entry-api-frontend branch from 7f8658a to c18010e Compare May 6, 2024 09:39
@praseodym
Copy link
Contributor

I think I fixed the current CI error in 7f8658a but that commit got replaced by an older one by accident. Could you rebase and pick 7f8658a instead of cc49795?

@praseodym praseodym linked an issue May 13, 2024 that may be closed by this pull request
@lkleuver lkleuver force-pushed the data-entry-api-frontend branch from 34cdc6b to 0fa76b8 Compare May 15, 2024 10:07
@lkleuver lkleuver marked this pull request as ready for review May 15, 2024 11:00
@lkleuver lkleuver requested a review from Lionqueen94 May 15, 2024 11:01
@praseodym praseodym changed the title Data entry api frontend Submit data entry from frontend to backend API May 15, 2024
Copy link
Contributor

@praseodym praseodym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just two minor comments.

@kiesraad kiesraad deleted a comment from vercel bot May 16, 2024
@praseodym
Copy link
Contributor

praseodym commented May 17, 2024

The failing Vercel check can be ignored, this is a remnant of me testing Vercel for PR deploys. I'm testing this in a test repository instead :)

@lkleuver lkleuver merged commit 205e5b6 into main May 17, 2024
2 of 3 checks passed
@lkleuver lkleuver deleted the data-entry-api-frontend branch May 17, 2024 11:03
lkleuver added a commit that referenced this pull request May 17, 2024
* fix conflict

* fix conflict

* Fix InputGrid casing

* fix conflict

* prettier reformat

* broken commit

* refactor ApiClient
add example test

* remove mockServiceWorker from repository

* remove mock code

---------

Co-authored-by: Mark Janssen <20283+praseodym@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Submit data from frontend to backend
4 participants